<template>
  <div>
   <el-button type="primary" @click="add()">添加</el-button>
    <v-list @edit="edit"></v-list>
   <v-add :obj="obj" ref="oCh"></v-add>
  </div>
</template>
<script>
import vAdd from "./components/add.vue"
import vList from "./components/list.vue"
  export default {
    data() {
      return {
       obj:{
         isTrue:false
       }
      }
    },
    methods: {
      //添加
      add(){
        this.obj.isTrue = true;
        this.obj.isAdd= true
      },
      edit(id){
     this.obj.isTrue =true
     this.obj.isAdd =false
     this.$refs.oCh.getOne(id)
      }
    },
    components: {
      vAdd,
      vList,
    },
    mounted() {},
    destroyed() {},
  }
</script>
<style>
</style>